/* ==================================================================
* Copyright (c) 2024/11/15 SCNU LiuJunJie z-ken
* All rights reserved.
* fileName:	func_read.hpp
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the xxx Group. and
* its contributors.
* 4. Neither the name of the Group nor the names of its contributors may
* be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY Author,GROUP AND CONTRIBUTORS
* ===================================================================
* Author: LiuJunJie z-ken.
*/

#pragma once
#include <iostream>
#include <fstream>
#include <vector>
#include "libs.hpp"
using namespace std;

#if !defined(FUNC_READ)
#define FUNC_READ
class UtilFunc
{
public:
	static vector<string> readFile(string s)
	{
		vector<string> ret;
		string data;
		ifstream ifs(s);

		if (SHOW_READFILE)
		{
			cout << "readDatas:" << endl;
		}

		while (std::getline(ifs, data))
		{
			ret.push_back(data);
			if (SHOW_READFILE)
			{
				cout << data << endl;
			}
		}

		ifs.close();
		return ret;
	}
};

#endif // FUNC_READ
